﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GDIT.BLL;
using GDIT.Base.PageBaseHelper;
using GDIT.Model;

namespace GDIT.page.manage.content
{
    public partial class contentList : System.Web.UI.Page
    {

        private BCollegeInfo college = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(Session["UserName"].ToString()))
                {
                    PageBase.MessageBoxShowAndGo("检查到你还没有登录，请先登录，谢谢！", "~/page/manage/login.aspx", Page);
                    return;
                }
                if (!IsPostBack)
                {
                    BindGeneralData();
                    BindLifeData();
                }
            }
            catch (Exception ex)
            {
                PageBase.MessageBoxShow("操作失败，原因：" + ex.Message.ToString(), Page);
            }
        }

        private void BindGeneralData()
        {
            college = new BCollegeInfo();
            this.generalRepeater.DataSource = college.SelectAllCollegeInfo("general");
            this.generalRepeater.DataBind();
        }

        private void BindLifeData()
        {
            college = new BCollegeInfo();
            this.lifeRepeater.DataSource = college.SelectAllCollegeInfo("life");
            this.lifeRepeater.DataBind();
        }
    }
}